<?php

namespace App\Http\Middleware;

use Closure;
use DB;

class LoginMiddleware
{
    /**
     * Handle an incoming request.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \Closure  $next
     * @return mixed
     */
    public function handle($request, Closure $next)
    {
        //request变量 记录所有的请求参数
        if(!$request->cookie('uid')) {
            return redirect('admin/login');
        } 
        return $next($request);
    }

}
